<?php
if (isset($_SESSION['admin-login'])) {
	if (isset($_POST['update'])) {
		db_query("UPDATE produk SET featured = 0");
		db_query("UPDATE produk SET featured = 1 WHERE id = ".intval($_POST['featured1']));
		db_query("UPDATE produk SET featured = 1 WHERE id = ".intval($_POST['featured2']));
		db_query("UPDATE produk SET featured = 1 WHERE id = ".intval($_POST['featured3']));
		$_SESSION['status-featured'] = "Produk featured sudah diedit";
		header("Location: ".site()."/".$param[0]."/featured");
	}
} else {
	$_SESSION['status-login'] = "Log in terlebih dahulu untuk melanjutkan";
	header("Location: ".site()."/".$param[0]."/login");
}
?>